0% found this document useful (0 votes)
26 views3 pages

Lesson Objective: 3.1: Select Data. This Objective May Include But Is Not Limited To: Understanding How Data

The document provides instructions and examples for using INSERT statements to add data to database tables. It includes sample data for tables called Student_Info and Class_Info. It then lists 5 INSERT statements with explanations: 1) adds a new row to the Class_Info table, 2) inserts data into selected columns of Class_Info, 3) inserts data into two columns of Class_Info, 4) copies data from Student_Info to a backup table with a SELECT statement, and 5) uses a JOIN to insert student last names into a table where they are enrolled in a math class based on matching Class_Ids between the tables.

Uploaded by

Carlos Díaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views3 pages

Lesson Objective: 3.1: Select Data. This Objective May Include But Is Not Limited To: Understanding How Data

The document provides instructions and examples for using INSERT statements to add data to database tables. It includes sample data for tables called Student_Info and Class_Info. It then lists 5 INSERT statements with explanations: 1) adds a new row to the Class_Info table, 2) inserts data into selected columns of Class_Info, 3) inserts data into two columns of Class_Info, 4) copies data from Student_Info to a backup table with a SELECT statement, and 5) uses a JOIN to insert student last names into a table where they are enrolled in a math class based on matching Class_Ids between the tables.

Uploaded by

Carlos Díaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

98-364 DATABASE ADMINISTRATION FUNDAMENTALS

STUDENT ACTIVITY 3.2: UTILIZING INSERT

MTA Course: Database Administration Fundamentals


Topic: Insert data
File name: DBAdminFund_SA_3.2

Lesson Objective:
3.1: Select data. This objective may include but is not limited to: understanding how data
is inserted into a database; how to use INSERT statements.

Content:
Apply the following INSERT statements to the data shown below. Record the results in
the table views provided.
Student Id Last_ Name First_Name Birthday Tuition Sex Class_Id_1 Class_Id_2
1243 Holt Holly 10-5-1990 10000 F 111 222
2435 Houston Peter 1-25-1991 5000 M 323 476
3756 Raheem Michael 6-18-1990 4000 M 222 476
4456 Jacobson Lola 8-7-1997 9000 F 476 323
5865 Higa Sidney 11-21-2000 12000 F 111 222
6674 Johnson Brian 4-15-1989 500 M 222 112
7456 Bentley Sean 2-17-1990 350 M 111 476
8934 Price Jeff 10-5-1990 2000 M 222 323
5718 Ashton Chris 1-1-1951 50 M 222

Student_Info

Class_Id Subject Room Start_Time


111 English Hall A 12:30 PM
222 Math 2354c 4:20 PM
323 Science Hall B 6:15 PM
476 Social Studies 4576c 8:45 AM

Class_Info
98-364 DATABASE ADMINISTRATION FUNDAMENTALS

1. INSERT INTO Class_Info VALUES (587,’Computer Information Systems’,’


Hall 12’,’10:35 AM’)

2. INSERT INTO Class_Info (Class_Id,Subject,Start_Time)


VALUES (2769,’Drivers Education’,’3:15 PM’)

3. INSERT INTO Class_Info (Class_ID, Room)


VALUES (2234,‘Art’)
98-364 DATABASE ADMINISTRATION FUNDAMENTALS

4. INSERT INTO Stu_Bkup (Id, Last, First,Class)


SELECT (Student_Id, Last_ Name, First_Name ,Class_Id_1)
FROM Student_Info
WHERE Class_Id_1> 0 or Class_Id_2 > 0

5. INSERT INTO Class_Enrollment (Name) 


SELECT Student_Id.Last_Name FROM Student_Info 
INNER JOIN Class_Info ON Student Id.Class_Id_2 = Class_Info. Class_Id
WHERE Class_Info.Subject= ‘Math’

You might also like