DROP TABLE INTEREST; DROP TABLE FIELD; DROP TABLE AUTHOR; DROP TABLE PAPER; DROP TABLE ACADEMIC; DROP TABLE DEPARTMENT; create table DEPARTMENT ( DEPTNUMinteger not null, DESCRIPchar(10),...

1 answer below »
kindly check all the requirements



DROP TABLE INTEREST; DROP TABLE FIELD; DROP TABLE AUTHOR; DROP TABLE PAPER; DROP TABLE ACADEMIC; DROP TABLE DEPARTMENT; create table DEPARTMENT ( DEPTNUMintegernot null, DESCRIPchar(10), INSTNAMEchar(80), DEPTNAMEchar(80), STATEchar(4), POSTCODEinteger, primary key (DEPTNUM) ); create table ACADEMIC ( ACNUMintegernot null, DEPTNUMintegernot null, FAMNAMEchar(20), GIVENAMEchar(20), INITIALSchar(10), TITLEchar(10), primary key (ACNUM), foreign key (DEPTNUM) references DEPARTMENT ); create table PAPER ( PANUMintegernot null, TITLEchar(100), primary key (PANUM) ); create table AUTHOR ( PANUMintegernot null, ACNUMintegernot null, foreign key (PANUM) references PAPER, foreign key (ACNUM) references ACADEMIC, primary key (PANUM, ACNUM) ); create table FIELD ( FIELDNUMintegernot null, IDchar(10)not null, TITLEchar(80), primary key (FIELDNUM) ); create table INTEREST ( FIELDNUMintegernot null, ACNUMintegernot null, DESCRIPchar(80), foreign key (FIELDNUM) references FIELD, foreign key (ACNUM) references ACADEMIC, primary key (FIELDNUM, ACNUM) ); insert into DEPARTMENT values (100, 'GU CIT', 'Griffith University', 'School of Computing and Information Technology', 'Qld', 4111); insert into DEPARTMENT values (101, 'JCU CS', 'James Cook University of North Queensland', 'Computer Science', 'Qld', 4811); insert into DEPARTMENT values (102, 'LTU CSCE', 'La Trobe University', 'Computer Science and Computer Engineering', 'VIC', 3083); insert into DEPARTMENT values (103, 'MQU MPCE', 'Macquarie University', 'Computing', 'NSW', 2109); insert into DEPARTMENT values (104, 'MQU RCASE', 'Macquarie University', 'JRCASE', 'NSW', 2109); insert into DEPARTMENT values (105, 'MNU CS', 'Monash University (Clayton)', 'Computer Science', 'VIC', 3168); insert into DEPARTMENT values (106, 'MRU CS', 'Murdoch University', 'Computer Science', 'WA', 6150); insert into DEPARTMENT values (107, 'NUS ISCS', 'National University of Singapore', 'Information Systems and Computer Science', '', 0); insert into DEPARTMENT values (108, 'QUT CS', 'Queensland University of Technology', 'Computing Science', 'QLD', 4000); insert into DEPARTMENT values (109, 'SUT IT', 'Swinburne University of Technology', 'School of Information Technology', 'VIC', 3122); insert into DEPARTMENT values (110, 'ANU CSL', 'Australian National University', 'Computer Science Laboratory', 'ACT', 0200); insert into DEPARTMENT values (111, 'ADFA CS', 'University College - ADFA - UNSW', 'Computer Science', 'ACT', 2600); insert into DEPARTMENT values (112, 'UA CS', 'University of Adelaide', 'Computer Science', 'SA', 5005); insert into DEPARTMENT values (113, 'UC ISE', 'University of Canberra', 'Information Sciences and Engineering', 'ACT', 2616); insert into DEPARTMENT values (114, 'UNE MSCS', 'University of New England', 'Mathematics - Statistics and Computing Science', 'NSW', 2351); insert into DEPARTMENT values (115, 'UNC CS', 'University of Newcastle', 'Computer Science', 'NSW', 2308); insert into DEPARTMENT values (116, 'UQ IT', 'University of Queensland', 'School of Information Technology', 'Qld', 4072); insert into DEPARTMENT values (118, 'FU CS', 'Flinders University', 'Department of Computer Science', 'SA', 5001); insert into DEPARTMENT values (119, 'USA CIS', 'University of South Australia', 'School of Computer and Information Science', 'SA', 5095); insert into DEPARTMENT values (120, 'UTH CS', 'University of Tasmania - Hobart', 'Department of Computer Science', 'TAS', 7001); insert into DEPARTMENT values (121, 'UTL ACM', 'University of Tasmania at Launceston', 'Applied Computing and Mathematics', 'Tas', 7250); insert into DEPARTMENT values (122, 'UTS CS', 'University of Technology - Sydney', 'School of Computing Sciences', 'NSW', 2007); insert into DEPARTMENT values (123, 'UWSN DC', 'University of Western Sydney - Nepean', 'Department of Computing', 'NSW', 2747); insert into DEPARTMENT values (124, 'UB MC', 'University of Ballarat', 'School of Mathematics and Computing', 'VIC', 3353); insert into DEPARTMENT values (125, 'UM CS', 'University of Melbourne', 'Computer Science', 'VIC', 3052); insert into DEPARTMENT values (126, 'RMIT CS', 'Royal Melbourne Institute of Technology', 'Computer Science', 'VIC', 3001); insert into DEPARTMENT values (127, 'CSIRO DIT', 'Commonwealth Scientific and Industrial Research Org', 'Division of Information Technology', 'ACT', 2601); insert into DEPARTMENT values (128, 'SU CS', 'University of Sydney', 'Basser Department of Computer Science', 'NSW', 2006); insert into DEPARTMENT values (129, 'DSTO ITD', 'Defence Science and Technology Organisation', 'Information Technology Division', null, 0); insert into DEPARTMENT values (130, 'UQ CITR', 'University of Queensland', 'Centre for Information Technology Research', 'Qld', 4072); insert into DEPARTMENT values (131, 'UQ CRCDST', 'University of Queensland', 'CRC for Distributed Systems Technology', 'Qld', 4072); insert into DEPARTMENT values (132, 'BU IT', 'Bond University', 'School of Information Technology', 'Qld', 4229); insert into DEPARTMENT values (133, 'CUT CS', 'Curtin University of Technology', 'Computer Science', 'WA', 6001); insert into DEPARTMENT values (134, 'QUT ISRC', 'Queensland University of Technology', 'Information Security Research Centre', 'Qld', 4001); insert into DEPARTMENT values (135, 'ECU CS', 'Edith Cowan University', 'Computer Science', 'WA', 6050); insert into DEPARTMENT values (136, 'MIAST NLP', 'Microsoft Institute of Adv Software Technology', 'NLP Research Unit', 'NSW', 2113); insert into DEPARTMENT values (137, 'UNSW CSE', 'University of New South Wales', 'School of Computer Science and Engineering', 'NSW', 2052); insert into DEPARTMENT values (138, 'UWA CS', 'University of Western Australia', 'Computer Science', 'WA', 6907); insert into DEPARTMENT values (139, 'USQ MC', 'University of Southern Queensland', 'Department of Mathematics and Computing', 'Qld', 4350); insert into DEPARTMENT values (140, 'QUT DSTC', 'Queensland University of Technology', 'CRC for Distributed Systems Technology', 'Qld', 4000); insert into DEPARTMENT values (141, 'ANU CS', 'Australian National University', 'Department of Computer Science', 'ACT', 0200); insert into DEPARTMENT values (142, 'UM DIS', 'University of Melbourne', 'Department of Information Systems', 'VIC', 3052); insert into DEPARTMENT values (143, 'MNU GSCIT', 'Monash University', 'Gippsland School of Computing and I.T.', 'VIC', 3842); insert into DEPARTMENT values (144, 'CQUMC', 'Central Queensland University', 'Department Mathematics and Computing', 'QLD', 4702); insert into DEPARTMENT values (145, 'MNU SD', 'Monash University', 'Department of Software Development', 'VIC', 3145); insert into DEPARTMENT values (146, 'VUT CS', 'Victoria University of Technology', 'Computer Science Department', 'VIC', 3088); insert into DEPARTMENT values (147, 'NONE', 'No longer working in Australia', null, null, 0); insert into DEPARTMENT values (148, 'UNKNOWN', 'Has moved. Old address no longer valid.', null, null, 0); insert into ACADEMIC values (100, 100, 'Kornreich', 'Jeroen', 'J D', 'AProf'); insert into ACADEMIC values (101, 100, 'Yee', 'Mark', 'M D', 'Dr'); insert into ACADEMIC values (102, 100, 'Fernandes', 'Russell', 'R T J', 'Mr'); insert into ACADEMIC values (103, 100, 'Cohen', 'Richard', 'R R A', 'AProf'); insert into ACADEMIC values (104, 100, 'Polemitis', 'Joe', 'J L', 'Miss'); insert into ACADEMIC values (105, 100, 'Brower', 'Tony', 'T B', 'AProf'); insert into ACADEMIC values (106, 100, 'Royce', 'Mel', 'M P', 'Prof'); insert into ACADEMIC values (107, 100, 'Christine', 'Leonardo', 'L T P', 'Mr'); insert into ACADEMIC values (108, 100, 'Brandon', 'Chuck', 'C A', 'Dr'); insert into ACADEMIC values (109, 101, 'Gustafsson', 'Hakan', 'H O Y', 'Dr'); insert into ACADEMIC values (111, 132, 'Barton', 'Michel', 'M G K', 'Prof'); insert into ACADEMIC values (113, 101, 'Sadhal', 'Sharanya', 'S B', 'Dr'); insert into ACADEMIC values (114, 101, 'Morley', 'Chris', 'C M T', 'Ms'); insert into ACADEMIC values (115, 145, 'Garton', 'Graham', 'G A S M', 'Dr'); insert into ACADEMIC values (116, 147, 'Nair', 'Marc', 'M P', 'Mr'); insert into ACADEMIC values (117, 101, 'Baliga', 'Lance', 'L G C', 'Dr'); insert into ACADEMIC values (118, 145, 'Rickert', 'Hannu', 'H X', 'Dr'); insert into ACADEMIC values (119, 102, 'Lamkin', 'Bas', 'B M', 'Dr'); insert into ACADEMIC values (120, 102, 'Tang', 'Greg', 'G J', 'Mr'); insert into ACADEMIC values (121, 102, 'Skelton', 'Robert', 'R R S', 'Mr'); insert into ACADEMIC values (122, 142, 'Harris', 'Mark', 'M J L', 'Mr'); insert into ACADEMIC values (123, 102, 'Wyld', 'Mitchell', 'M S', 'Dr'); insert into ACADEMIC values (124, 102, 'Haenssgen', 'Francis', 'F A', 'Mr'); insert into ACADEMIC values (125, 102, 'Ahlberg', 'Grosek', 'G F', 'Ms'); insert into ACADEMIC values (126, 102, 'Bodoh', 'Anne', 'A S', 'Dr'); insert into ACADEMIC values (127, 102, 'Hathaway', 'Walley', 'W J', 'Dr'); insert into ACADEMIC values (128, 102, 'Silvermane', 'Ajay', 'A A N', 'Dr'); insert into ACADEMIC values (129, 102, 'Hopkins', 'Sheldon', 'S T', 'AProf'); insert into ACADEMIC values (130, 102, 'Correll', 'Tim', 'T N K', 'Dr'); insert into ACADEMIC values (131, 102, 'Ruschak', 'Robert', 'R H K', 'Mr'); insert into ACADEMIC values (132, 103, 'Bataille', 'Michael', 'M J', 'Prof'); insert into ACADEMIC values (133, 103, 'Reichelt', 'Lee', 'L M A', 'Dr'); insert into ACADEMIC values (134, 103, 'Owen', 'Kenneth', 'K M', 'Dr'); insert into ACADEMIC values (135, 103, 'Carroll', 'Ulf', 'U K', 'Dr'); insert into ACADEMIC values (137, 105, 'Chalmers', 'Bijan', 'B D', 'Dr'); insert into ACADEMIC values (138, 105, 'Mayston', 'Brian', 'B A J', 'AProf'); insert into ACADEMIC values (139, 105, 'Marziani', 'Rolf', 'R K B', 'Dr'); insert into ACADEMIC values (140, 105, 'Wheeler', 'Ben', 'B K', 'Dr'); insert into ACADEMIC values (141, 105, 'Ashley', 'Maria', 'M J', 'Mr'); insert into ACADEMIC values (142, 105, 'Lawitzke', 'Ky', 'K R T', 'Dr'); insert into ACADEMIC values (143, 106, 'Stewart', 'Andrew', 'A D P', 'Dr'); insert into ACADEMIC values (144, 106, 'Kinsella', 'Declan', 'D G G', 'Prof'); insert into ACADEMIC values (145, 106, 'Prakash', 'Kate', 'K H', 'Dr'); insert into ACADEMIC values (146, 107, 'Marcy', 'Ike', 'I H', 'Ms'); insert into ACADEMIC values (147, 108, 'Witt', 'Brian',
Answered Same DayMay 18, 2021

Answer To: DROP TABLE INTEREST; DROP TABLE FIELD; DROP TABLE AUTHOR; DROP TABLE PAPER; DROP TABLE ACADEMIC;...

Neha answered on May 22 2021
154 Votes
· select givename, famname, instname from academic natural join department where acnum in (select acnum from author where acnum not in (select acnum from interest group by acnum)) and deptNum in (select deptNum from academic where deptname = ‘Computer Science’);
In this query, it has subqueries. The join is performed on academic and department table. The subquery is for the where clause. The acnum is selected which is not present in the interest table. The deptNum is selected which is present in the academic table and have computer science as the department name. The subquery is treated as the inner query. It executes before the main query.
1.2
We need to include self-join on the table author and the group by will be performed on each table.
select A1.PaNum, count(A1.AcNum) from Author A1
inner join Author A2
where A1.PaNum = A2.PaNum group by A1.PaNum, A2.PaNum;
1.3 Select * from department where DESCRIP    is not null;
1.4 Select Paper.PANUM, Paper.TITLE from Paper
Inner join AUTHOR on Author.PANUM = Paper.PANUM where Author.ACNUM = 100;
1.5 Select Author.ACNUM, givename, famName, count(PANUM) from Academic
Right join Author on Academic.ACNUM =Author.ACNUM
group by Author.ACNUM, givename, famName;
1.6 Select ID,field.fieldNum, count(ACNUM) from field
Inner join interest on interest.FIELDNUM = FIELD.FIELDNUM
Where ID like '%.1.%' group by ID, givename, famName;
1.7 Select...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here