-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathP07.sql
More file actions
22 lines (21 loc) · 679 Bytes
/
P07.sql
File metadata and controls
22 lines (21 loc) · 679 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--CREATING TABLE PEOPLE FOR PROBLEM 07 --
CREATE TABLE [People](
[Id] INT PRIMARY KEY IDENTITY(1,1),
[Name] NVARCHAR(200) NOT NULL,
[Picture] VARBINARY(MAX),
CHECK (DATALENGTH([Picture]) <= 2000000),
[Height] DECIMAL(3,2),
[Weight] DECIMAL(5,2),
[Gender] CHAR(1) NOT NULL,
CHECK ([Gender] = 'm' OR [Gender] = 'f'),
[Birthdate] DATE NOT NULL,
[Biography] NVARCHAR(MAX)
)
INSERT INTO [People]([Name],[Height],[Weight],[Gender],[Birthdate])
VALUES
('Pesho',1.77,76.2,'m','1997-12-12'),
('Gosho',NULL,NULL,'m','1997-12-15'),
('Maria',1.77,76.2,'f','1997-01-12'),
('Ivanka',NULL,50.50,'f','1997-05-12'),
('Peshkata',1.70,NULL,'m','1997-06-12')
SELECT * FROM [People]