Tham khảo tài liệu 'giáo trình sql bài 5', công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Lab 02 Company Database 1 Lab 02 Company Database 1. Create Database Company CREATE DATABASE Company ON PRIMARY NAME Company FILENAME C DATA SIZE 2048KB MAXSIZE UNLIMITED FILEGROWTH 1024KB LOG ON NAME Company log FILENAME C DATA SIZE 1024KB MAXSIZE 2048KB FILEGROWTH 10 Note Save to file 2. Create tables - Priamry Key - Foreign Key Lab 02 Company Database 2 Table Structure Employee_ Field Name Data Type Null FName varchar 15 NOT NULL MInit varchar 1 NULL LName varchar 15 NOT NULL SSN char 9 NOT NULL BDate datetime NULL Address varchar 30 NULL Sex char 1 NULL Salary numeric 10 2 NULL SuperSSN char 9 NULL DNo numeric 4 0 NULL Department Field Name Data Type Null DName varchar 15 NOT NULL Number numeric 4 0 NOT NULL Mgrssn char 9 NULL MgrStartdate datetime NULL Department Location Field Name Data Type Null Number numeric 4 0 NOT NULL Location varchar 15 NOT NULL Project Field Name Data Type Null PName varchar 15 NOT NULL PNumber numeric 4 0 NOT NULL PLocation varchar 15 NULL DNum numeric 4 0 NOT NULL Works on Field Name Data Type Null ESSN char 9 NOT NULL PNo numeric 4 0 NOT NULL Hours numeric 4 1 NULL Dependent Field Name Data Type Null ESSN char 9 NOT NULL ependentName varchar 15 NOT NULL Sex char 1 NULL BDate datetime NULL Relationship varchar 8 NULL Note Save to file Lab 02 Company Database 3 3. Insert Data In 2 tables Employee and Department when entering data into table the data is entered first and other is enterd next. After they can update. Employee__ FName Minit LName SSN BDate Address Sex Salary Supper SSN DNo John B Smith 123456789 01 09 1955 Houston TX M 30000 333445555 5 Franklin T Wong 333445555 12 08 1945 Houston TX M 40000 888665555 5 Joyce A English 453453453 07 31 1962 Houston TX F 25000 333445555 5 Ramesh K Narayan 666884444 09 15 1952 Humble TX M 38000 333445555 5 James E Borg 888665555 11 10 1927 Houston TX M 55000 NULL 1 .