-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSQLAdvanced 10.sql
More file actions
39 lines (39 loc) · 897 Bytes
/
SQLAdvanced 10.sql
File metadata and controls
39 lines (39 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
select * from Person.BusinessEntity
select * from Person.PersonPhone
select * from Person.Password
-- lets execute proc
sp_helptext uspGetBillOfMaterials 4235,'2017-11-06 19:50:03.020'
sp_help uspGetBillOfMaterials
select * from Person.Address
SELECT
CONCAT(
CHAR(13),
CONCAT(City,' ',AddressLine1),
char(20),
AddressID,
CHAR(13),
CONCAT(city,' ',StateProvinceID),
CHAR(13),
PostalCode
) customer_address
FROM
Person.Address
---product name
select * from Production.Product
select Name,
LEFT(Name,7) first_7character
from Production.Product
order by Name;
----
SELECT
LEFT(Name, 1) initial,
COUNT(Name) product_count
FROM
Production.Product
GROUP BY
left(Name, 1)
ORDER BY
initial;
--
select * from Sales.PersonCreditCard
select * from Sales.SalesOrderDetail