5-4. Perform an experiment to determine the precedence in a query with three conditions linked by AND and OR. Find out w

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

5-4. Perform an experiment to determine the precedence in a query with three conditions linked by AND and OR. Find out w

Post by answerhappygod »

5 4 Perform An Experiment To Determine The Precedence In A Query With Three Conditions Linked By And And Or Find Out W 1
5 4 Perform An Experiment To Determine The Precedence In A Query With Three Conditions Linked By And And Or Find Out W 1 (156.03 KiB) Viewed 41 times
5 4 Perform An Experiment To Determine The Precedence In A Query With Three Conditions Linked By And And Or Find Out W 2
5 4 Perform An Experiment To Determine The Precedence In A Query With Three Conditions Linked By And And Or Find Out W 2 (56.76 KiB) Viewed 41 times
Here is the table used
SQL> SELECT *2 FROM rearp.Section;
SECTION_ID COURSE_NUM SEMESTER YEAR---------- ------------------------ ------------------ ------INSTRUCTOR BLDG ROOM------------------------------ ---------- ----------85 MATH2410 FALL 14KING 36 123
86 MATH5501 FALL 14EMERSON 36 123
87 ENGL3401 FALL 15HILLARY 13 101
SECTION_ID COURSE_NUM SEMESTER YEAR---------- ------------------------ ------------------ ------INSTRUCTOR BLDG ROOM------------------------------ ---------- ----------88 ENGL3520 FALL 16HILLARY 13 101
89 ENGL3520 SPRING 16HILLARY 13 101
90 COSC3380 SPRING 16HARDESTY 79 179
SECTION_ID COURSE_NUM SEMESTER YEAR---------- ------------------------ ------------------ ------INSTRUCTOR BLDG ROOM------------------------------ ---------- ----------91 COSC3701 FALL 1479 179
92 COSC1310 FALL 16ANDERSON 79 179
93 COSC1310 SPRING 16RAFAELT 79 179
SECTION_ID COURSE_NUM SEMESTER YEAR---------- ------------------------ ------------------ ------INSTRUCTOR BLDG ROOM------------------------------ ---------- ----------94 ACCT3464 FALL 15RODRIGUEZ 74
95 ACCT2220 SPRING 15RODRIQUEZ 74
96 COSC2025 FALL 17RAFAELT 79 179
5-4. Perform an experiment to determine the precedence in a query with three conditions linked by AND and OR. Find out whether AND, OR, or left-to-right take precedence? Use statements like this (actual attribute names may be found using "DESC Student"): Run this query: SELECT FROM WHERE Student stno < 100 AND major = 'COSC' OR major = 'ACCT'; Then run the following two queries and answer whether the non-parenthesized statement gives you: SELECT FROM WHERE Student (stno < 100 AND major = 'COSC') OR major = 'ACCT';
or: SELECT FROM WHERE Student stno < 100 AND (major = 'COSC' OR major = 'ACCT'); What happens if you put the OR first instead of the AND and run the query without parentheses? 131
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply