0% found this document useful (6 votes)
647 views1 page

Tema4 SQL 1

The document contains instructions for performing multiple queries on 'Locations' and 'Events' tables including selecting rows that meet certain criteria, performing aggregate functions, joining tables, and ordering results.

Uploaded by

MariaBufnea
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 (6 votes)
647 views1 page

Tema4 SQL 1

The document contains instructions for performing multiple queries on 'Locations' and 'Events' tables including selecting rows that meet certain criteria, performing aggregate functions, joining tables, and ordering results.

Uploaded by

MariaBufnea
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/ 1

Compute the following:

1. Perform the following queries on "Locations" table:

a. select all locations that have the capacity between 200 and 1000 persons

b. select all locations that have "a" in their name

c. Select all locations that are not in Cluj-Napoca

d. Select all locations that have the cost 0,500,600, are in Brasov and Cluj-Napoca, and han
sustain a capacity greater that 1000 persons

2. Perform the following queries on "Events" table:

a. return the results for min, max, average based on "EventCost" column

b. count how many events are associated to location 1 and 2

c. compute the average cost obtained from location 1

d. order the events based on their defined date

e. compute the total cost associated with each location (hint grouped by)

3. Perform the following queries using both tables

a. Order location name, descending, after their associated event cost

b. Select location name, location cost and event cost for a specific event

c. Return the first 3 events (with eventName, locationname), that have the greatest event cost, in
alphabetical order (after their names)

You might also like