Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

Research Paper University of West Florida - COP 4710 SQL_4 GRADED

Beoordeling
-
Verkocht
-
Pagina's
14
Cijfer
A
Geüpload op
27-06-2021
Geschreven in
2020/2021

Display the COUNT of rows in each of the tables: Grade_report, Student, and Section. How many rows would you expect in the Cartesian product of all three tables? Display the COUNT (not the resulting r ows) of the Cartesian product of all three and verify your result. Use SELECT COUNT(*) ... Cartesian Product of all three tables: grade_report * student * section Display the COUNT of section-ids from the Section table, and then the COUNT of DISTINCT section-ids from the Grade_report table. What does this information tell you? Hint: section_id is the primary key of the Section table. The Cartesian is highest number count for each table multiplied with other table. For section row count would be 32 and Grade_report would be 209. Get the statement to work as a COUNT of a join of the three tables, Student, Grade_report, 105 and Section. Use table aliases in the join condition (remember to use /* join conditions */). Note that a join of n tables requires (n-1) join conditions, so here you have to have two join conditions—one to join the Student and Grade_report tables, and one to join the Grade_report and Section tables. Note the number of rows that you get (expect no more rows than is in the Grade_report table.) Why? Modify the query and put the accounting (ACCT) condition in the WHERE clause. Note the number of rows in the result—it should be a good bit less than in (a). COUNT(*) Again, modify the query and add the grade constraints. The number of rows should decrease again. Note that if you have WHERE x and y or z, parentheses are optional, but then the criteria will be interpreted according to precedence rules. How many students have names like “SMITH” or “Smith”? How many have names that contain the letter sequence “SMITH”? How many student names end in “LD”? Would “SELECT * FROM Student WHERE sname LIKE ‘SMITH%’” find someone whose name was: (i) “LA SMITH” (ii) “SMITH-JONES” (iii) “SMITH JR.” (iv) “SMITH, JR” no rows selected Answer: No. Would you call UPPER or LOWER an aggregate function? Why or why not? Yes because the queries would produce the same result. – Pad all the student names in the Student table with ... on the right. List the junior level COSC courses (like COSC3xxx) and the name of the course. Use the Course table. Using the COUNT feature, determine whether there are duplicate names or student numbers in the Student table. Assume that all math courses start with MATH. How many math courses are there in the Section table? From the COUNT of courses, does it appear that there are any math courses in the Section table that are not in the Course table? Again, using COUNTs, are there any math courses in the Course table that are not in the Section table? Does it appear that there are any courses at all that are in the Grade_report, Section, or Course tables that are not in the others? (We will study how to ask these questions in SQL in a later chapter). Note that a query like the following would not work: SELECT on_id FROM Grade_report g, Section t WHERE on_id on_id; Explain why WHERE .. .. will not work to produce the desired output. Display dictionary views for the tables we have in the Student-Course database (refer to the diagram in Appendix 3 for all the table names). Use “all_tables” as the dictionary view. Do the query as follows: DESCRIBE the table with DESC all_tables; Display the number of rows in all_tables. Use SELECT COUNT(*) FROM all_tables; Observe that when you are exploring the dictionary, it is not a good idea to simply SELECT * FROM whatever, where whatever is some dictionary view. Dictionary views are often long and wide—wide in that there are often many attributes and many of those attributes are not necessarily interesting. SQL SELECT COUNT(*) FROM ALL_TABLES; Display the owner and table_name from all_tables where owner = ‘your userid’. Display the first two rows (use WHERE rownum 3) of the all_tables table. MAX_TRANS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS PCT_INCREASE FREELISTS FREELIST_GROUPS LOGGING BAC NUM_ROWS BLOCKS EMPTY_BLOCKS AVG_SPACE CHAIN_CNT AVG_ROW_LEN AVG_SPACE_FREELIST_BLOCKS NUM_FREELIST_BLOCKS DEGREE INSTANCES CACHE TABLE_LOCK SAMPLE_SIZE LAST_ANALYZED PARTITION IOT_TYPE TEM SEC NESTED BUFFER_POOL FLASH_CACHE CELL_FLASH_CACHE ROW_MOVEMENT GLOBAL_ST USER_STAT COMPRESS_FOR DROPPED READ_ONLY SEGMENT_C RESULT_CACHE For Room, Course, Prereq, Department_to_major, list the attributes, number of rows, number of distinct rows, and number of rows without nulls. As you gather the information, put the information in a tabular format, as shown below (note – you may want to create this table in your word processor as you gather the information): all the tables in the Student-Course database – Student, Grade_report, Section, Table Student Section Attribute stno sname major class section_id Rows without Nulls 48 48 3 etc. Rows Distinct Rows 48 48 47 8 etc. etc. Also, note that there is probably no “one” query that will give you this information. You will have to find this information using separate queries, and then put the information together in a tabular format. Hint: you can use: SELECT COUNT (*) FROM Student WHERE sname IS NULL Find the count, sum, average, minimum, and maximum capacity of rooms in the database (hint: Use the Room table for this question). SQL SELECT COUNT(CAPACITY), SUM(CAPACITY), AVG(CAPACITY), MIN(CAPACITY), MAX(CAPACITY) 2 FROM ; COUNT(CAPACITY) SUM(CAPACITY) AVG(CAPACITY) MIN(CAPACITY) MAX(CAPACITY) --------------- ------------- ------------- ------------- ------------- Where there is a null value for the capacity, assume the capacity to be 40, and find the average room size again. In Chapter 2, we introduced some date functions, namely ADD_MONTHS and MONTHS_ BETWEEN. Use the MONTHS_BETWEEN and other appropriate functions to write one query that returns the number of years between the oldest and youngest student in the Student table.

Meer zien Lees minder
Instelling
Vak









Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
27 juni 2021
Aantal pagina's
14
Geschreven in
2020/2021
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

€8,44
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
GradeProfessor Chamberlain College Of Nursing
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
1094
Lid sinds
5 jaar
Aantal volgers
1005
Documenten
2196
Laatst verkocht
4 weken geleden

Quality Exams is Key to Students Career Excellence Nursing is my profession,however,I have acquired the necessary skills & knowledge on economics,engineering,business,sociology,human resource management, marketing and psychology among others that you shall see as you download my work. All my uploaded documents, exams and essays are verified by relevant experts I can assure an A or at least 90% if you use any of my documents. I will strive my best to help you. RUBRIC GURU

Lees meer Lees minder
3,7

188 beoordelingen

5
101
4
21
3
22
2
2
1
42

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen