Database practice sql super detailed (end-of-term series)

1. Design question: Use code to complete the creation of database and table according to the following requirements. There are 3 sub-questions in this big question with a total of 40 points.

 

1. Create a database, the name of the database is named after the student's own name. (4 points)

CREATE DATABASE 陆小马 
ON PRIMARY (
	NAME =陆小马_mdf,
	FILENAME = 'C:\陆小马_mdf.MDF',
	SIZE = 15MB,
	MAXSIZE = 30MB,
	FILEGROWTH = 20 %) 
LOG ON ( 
	NAME =陆小马_ldf, 
	FILENAME = 'C:\陆小马_ldf.LDF', 
	SIZE = 3MB, 
	MAXSIZE = 10MB, 
	FILEGROWTH = 1MB )

2. Create the following 3 tables, which are required to contain the definition of integrity constraints (primary key, foreign key, gender, etc.).

(1 ) For students (student ID, name, gender, professional class, date of birth, contact phone number), set the student ID as the main key and add check constraints to gender. The value range is shown in the table below. (10 points)

<

Guess you like

Origin blog.csdn.net/qq_30787727/article/details/111880230