Lab_03_AM08 - Solution - 7.104 DATABASE ENGINEERING I WEEK...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
7.104 DATABASE ENGINEERING I WEEK 03 – AM08 LAB / TUT SOLUTION DATABASE, SCHEMA, TABLES, COLUMNS, REFERENTIAL INTEGRITY CONSTRAINT, SQL QUERY This laboratory / tutorial exercise aims for the student to understand and gain skills on how to create database, execute a script to create tables follow by another script to insert data into tables being created. Student also needs to create SQL Queries to meet a specific requirement. It is recommended for students to follow the order as listed below; (A) SQL Server 2008 Database System 1. Login into SQL Server Management Studio 2. Open up script SQL_Student_CreateTable.sql and execute it 3. Open up script SQL_Student_InsertData.sql and execute it 4. Identify the database name, schema name, table name, column name, primary key foreign key and type of data. As the Tutor for help if you’re unable to identify them! 5. Create the Table Relationship Diagram, save to appropriate name 6. Perform the following SQL Queries a. List all attributes of the table STUDENT, CLASS and GRADE SELECT * FROM AIS.STUDENT; SELECT * FROM AIS.CLASS; SELECT * FROM AIS.GRADE; b. List all student name that their first name has the character “a” SELECT RTRIM(FirstName) + ‘ ‘ + RTRIM(LastName) AS StudentName
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
FROM AIS.STUDENT WHERE FirstName LIKE ‘%a%’; c. List all student name sort by last name in descending order and first name in ascending order SELECT RTRIM(FirstName) + ‘ ‘ + RTRIM(LastName) AS StudentName
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

Lab_03_AM08 - Solution - 7.104 DATABASE ENGINEERING I WEEK...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online