Purchase Solution

SQL Joins and Typical Query Usage.

Not what you're looking for?

Ask Custom Question

Create the following queries on the ITCO630_A database used in unit 3 and save them all in a file called ITCO630_P5.SQL. Please note that you can execute individual queries in a query file by highlighting the lines that you want to execute before running the script. Remember to define what database to use with a USE statement.

1. Using a join, get the full details of all the students who work on the mid-term exam assignment.
2. Get the assignment names (duplicates eliminated) being worked on by students at Central University.
3. Get the last names of all the students who are working on assignment A1.
4. Get the student numbers and start dates of all the students with start dates equal to the earliest date.
5. Insert yourself into the student table using the last five digits of your phone number as the student number and show yourself as attending Central University. Then show all the records in the student table.
6. Delete yourself from the student table by matching your student number, and then show all the records in the student table.

You should create a zip file called ITCO630_P5.ZIP with your query file (ITCO630_P5.SQL) included.

- Communicate with a relational database to create tables, and query and manipulate data.
- Use normalizing and data integrity methodologies when designing a database.
- Create and manage databases and their related components.

Purchase this Solution

Solution Preview

This project is a good exercise to use SQL joins and typical query usage.

Solution ITCO630_P5.SQL uses the USE database statement.

1. Using a join, get the full details of all the students who work on the mid-term exam assignment.

This is achieved by typical join between tables: [student], [Summary], [Assignment] and [School]
Note: all tables being joined by corresponding keys.
E.g. table [Student] joined by table [Summary] by Student_no.

Final solution:
SELECT A.student_no, A.student_fname,A.student_lname,D.school_name,D.city
FROM [DBO].[Student] AS A
INNER JOIN [dbo].[summary] AS B ON A.student_no = B.student_no
INNER JOIN [dbo].[assignment] AS C ON C.assignment_no = B.assignment_no
INNER JOIN [dbo].[school] AS D ON D.school_no = A.school_no
WHERE C.assignment_name ='Mid-term Exam'

2. Get the assignment names (duplicates eliminated) being worked on by students at Central University.

Using same solution above and added the condition: school_name = "Central University"
And one more key condition added is ...

Purchase this Solution


Free BrainMass Quizzes
Writing Business Plans

This quiz will test your understanding of how to write good business plans, the usual components of a good plan, purposes, terms, and writing style tips.

Marketing Management Philosophies Quiz

A test on how well a student understands the basic assumptions of marketers on buyers that will form a basis of their marketing strategies.

Organizational Behavior (OB)

The organizational behavior (OB) quiz will help you better understand organizational behavior through the lens of managers including workforce diversity.

Lean your Process

This quiz will help you understand the basic concepts of Lean.

Cost Concepts: Analyzing Costs in Managerial Accounting

This quiz gives students the opportunity to assess their knowledge of cost concepts used in managerial accounting such as opportunity costs, marginal costs, relevant costs and the benefits and relationships that derive from them.