0% found this document useful (0 votes)
4 views

Assignment2_ Lab_TGA

Lab6
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Assignment2_ Lab_TGA

Lab6
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Kingdom of Saudi Arabia ‫المملكة العربية‬

Ministry of Education ‫السعودية‬


Northern Border University ‫وزارة التعليم‬
Faculty of Computing and IT 2007-1428 ‫الحدود الشمالية‬ ‫جامعة‬
‫جامعة الحدود الشمالية‬ ‫العربية‬ ‫المملكة‬
Northern Border University ‫السعودية الحاسبات وتقنية‬
‫كلية‬
‫المعلومات‬
‫التعليم‬ ‫وزارة‬
‫جامعة الحدود‬

COURSE NAME: Database2

COURSE CODE: CPIT340 -TGB SECTION: Girls


‫المملكة العربية‬
‫السعودية‬
‫وزارة التعليم‬
TEACHER: Dr. Jihane Ben Slimane ‫جامعة الحدود‬

ASSIGNMENT 2_LAB
First Semester
Academic Year 1445/1446

STUDENT MARKS

STUDENT
Name: ___________________________________________________________

University ID: _________________________________________________

1
Activity List:

Task 1: CREATE Database


Q1. Save the database as assignment2.
Task 2: CREATE TABLE named students
 StudentID: int, primary key
 FirstName: varchar(30)
 LastName: varchar(30)
 EnrollmentYear: int
Q1. Modify the type of FirstName to VARCHAR(50).

Q2. Add a column Major to the students table with type VARCHAR(50)

Task 3: Write queries to insert records into the table students.

StudentID FirstName LastName EnrollmentYear Major


1001 John Doe 2020 Computer Sci.
1002 Jane Smith 2019 Biology
1003 Emma Johnson 2021 Mathematics

Q1. Write a query to implement the savepoint.


Q2. Write a query to update the Major and EnrollmentYear of the second record from students:

StudentID FirstName LastName EnrollmentYear Major


1001 John Doe 2020 Computer Sci.
1002 Jane Smith 2022 Chemistry
1003 Emma Johnson 2021 Mathematics

Q3. Write a query to delete the last record of the books table.
Q4. Write a query to implement the Rollback to the savepoint made in Q1.
Q5. Write a query to implement the COMMIT.

You might also like