We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.

SQL Queries - Essay Example

Comments (0) Cite this document
Summary to essay on topic "SQL Queries"
WHERE Company.co_id=Representative.co_id And Representative.rep_id=Rep_attendance.rep_id And Event.ev_id=Rep_attendance.ev_id And Event.ev_id=Student_attendance.ev_id And Student_attendance.stu_no=Student.stu_no And Representative.rep_id=Rep_attendance.rep_id And Event.ev_id=Rep_attendance.ev_id And Company.co_name='Perception';
Download full paper
Polish This Essay
SQL Queries
Read TextPreview

Extract of essay "SQL Queries"

Download file "SQL Queries" to see previous pages... Description
I have added a sub query in WHERE clause to filter those students who have no placement.

List the names and student ids for students who have gained employment with the company that they undertook a placement at.

SELECT DISTINCT Student.stu_fname, Student.
Let us write or edit the essay on your topic "SQL Queries" with a personal 20% discount.. Try it now
FROM Employment, Student, Placement
WHERE Student.stu_no=Employment.stu_no And Student.stu_no=Placement.stu_no And Placement.co_id=Employment.co_id;

In this query I have selected Employment, Student, Placement tables and have joined them. In addition to that, I have also patched Company ID of Placement with Employment table as well.

List the names and student ids for students that have undertaken precisely two (2) placements.

SELECT DISTINCT Student.stu_fname, Student.stu_no
FROM Student
WHERE (( SELECT count(*) FROM Placement WHERE
(Student.stu_no=Placement.stu_no) ) >= 2 );

I have added a sub query in WHERE clause to filter those students who have at least two placements.

List the names and student ids for all students and sort the list in reversed alphabetical order (Z to A).

SELECT DISTINCT Student.stu_fname, Student.stu_no
FROM Student
ORDER BY Student.stu_fname DESC;

In this query I have added ORDER BY clause to sort data in Descending order.

Show the average length for placements, where the placement is with Sony and the student goes on to gain employment (with any company).

SELECT Company.co_name, avg(SELECT count(*) FROM Placement, Student, Employment WHERE Placement.co_id=Company.co_id and student.stu_no=Employment.stu_no And student.stu_no=Placement.stu_no )
FROM company
GROUP BY Company.co_name, Company.co_id
HAVING Company.co_name='Sony';

First I have selected the Average number of placements...
In a correctly implemented database a student may not be employed and on a placement at the same point in time. However in such a database it is still possible for a student to secure employment before they have completed their placement (i.e. having a starting date for employment while still on placement). Create a query that lists all such occurrences. ...Download file "SQL Queries" to see next pagesRead More
Cite this document "SQL Queries"
  • APA
  • MLA
(“SQL Queries Essay Example | Topics and Well Written Essays - 750 words”, n.d.)
SQL Queries Essay Example | Topics and Well Written Essays - 750 words. Retrieved from https://studentshare.org/miscellaneous/1510631-sql-queries
(SQL Queries Essay Example | Topics and Well Written Essays - 750 Words)
SQL Queries Essay Example | Topics and Well Written Essays - 750 Words. https://studentshare.org/miscellaneous/1510631-sql-queries.
“SQL Queries Essay Example | Topics and Well Written Essays - 750 Words”, n.d. https://studentshare.org/miscellaneous/1510631-sql-queries.
  • Cited: 0 times
Comments (0)
Click to create a comment or rate a document
Lanchester Liners Hospitality Database, SQL
5 Pages(1250 words)Essay
Some of these include flat databases and a relational databases. A flat database contains only one table. A database which contains one or several related tables is referred to as a relational database (Harrington, 2002). In a relational database, symbols are organized into a collection of relations.
4 Pages(1000 words)Essay
This a DATABASE I.T assignment - EE-R Diagram, EE-R Model with 3NF relations and SQL statments
The symbol – “O” represents the overlapping nature of the relation. It also contemplates the fact that there can be an entity overlapping in both the sections, Elite and Sessional. The relationship “arranged” between the entities Elite Musician and Song is N
6 Pages(1500 words)Essay
Data Analysis
Every product has only one product category, therefore the association between the Product class and Product category class is one to one, i.e. one product have only one category. One customer can place one or more order,
10 Pages(2500 words)Essay
Modern Database Managment Assignment Three
The relational model employs a set of tables/relations to demonstrate both data as well as the associations between those data. In addition, each table contains numerous columns and each column has a unique name. Moreover, each
3 Pages(750 words)Essay
Information Systems
Following are the basic requirements of the proposed CDMS; CDMS is the hub of activities for the business. These activities are broad based and extend all over the business domain. The Chief Executive has to have a good idea of the all the business activities. He
6 Pages(1500 words)Essay
Advanced SQL Queries for the Pine Valley Furniture Company Database
In this query, we need to come up with the list of the products that have the lowest price. To get the result, we need to sort the prices of the products and choose the one that is the least among them all. In the parameters for the queries, we indicate that we would like to pick the top item from the field
2 Pages(500 words)Term Paper
SQL/DDL, nested queries, transactions
Ans. b) A dirty read can occur when a PASSENGER table is read for a passport_number. During transaction 2, the column passport_number is updated. Once updated , the next transaction will involve
2 Pages(500 words)Assignment
Database Administration -2
The following list provides all the required skills of the database administrator for information system database of large organizations (Kioskea,
4 Pages(1000 words)Essay
Advance Database
This aim of this report is to give a detailed description of the design for a relational database specifically proposed to fulfil the TFR data needs. The relational database system will enable TFR to
4 Pages(1000 words)Essay
Let us find you another Essay on topic SQL Queries for FREE!
Contact us:
Contact Us Now
FREE Mobile Apps:
  • About StudentShare
  • Testimonials
  • FAQ
  • Blog
  • Free Essays
  • New Essays
  • Essays
  • The Newest Essay Topics
  • Index samples by all dates
Join us:
Contact Us