Consider the relations Authors(auID,name) and Authoring(articleID,authorID), containing
information on names of authors, and who is authoring which papers, respectively.
i) Write an SQL query that returns for each article, its ID, title and the number of authors.
ii) Write an SQL query that returns the titles of articles authored by 'Robert Tarjan'.
iii) Write an SQL query that returns the number of co-authors of 'Robert Tarjan'. (I.e., the number of
authors who have written at least one article together with him
Write an SQL query that returns for each article, its ID, title and the number of authors.
You are searching for information on the cellphone suppliers Vodacom and Cell C excluding MTN. What would you type into a database search to find the most relevant sources for your topic?
a.
Vodacom AND Cell C AND MTN
b.
Vodacom OR Cell C AND MTN
c.
Vodacom OR Cell C NOT MTN
d.
Vodacom AND Cell C NOT MTN
Consider the relations Authors(auID,name) and Authoring(articleID,authorID), containing information on names of authors, and who is authoring which papers, respectively. i) Write an SQL query that returns for each article, its ID, title and the number of authors. ii) Write an SQL query that returns the titles of articles authored by 'Robert Tarjan'. iii) Write an SQL query that returns the number of co-authors of 'Robert Tarjan'. (I.e., the number of authors who have written at least one article together with him.)
Write SQL statements for the following.
● Provide screenshots of your answers. Copy and paste your screenshots
below each item
Create a database named Library.
2. Create tables with appropriate integrity constraints:
● Authors
o AuthorID – Primary Key, 5 characters
o AuthorName –30 characters
o Nationality – 20 characters
● Books
o BookID – Primary Key, 5 characters
o AuthorID – Foreign Key related to Authors
o BookTitle – 50 characters
o Genre – 30 characters
o YearPublished – year
Using inheritance, one class can acquire the properties of others. Consider the following Animal class:
class Animal{
void walk(){
System.out.println("I am walking");
}
}
This class has only one method, walk. Next, we want to create a Bird class that also has a fly method. We do this using extends keyword:
class Bird extends Animal {
void fly() {
System.out.println("I am flying");
}
}
Finally, we can create a Bird object that can both fly and walk.
public class Solution{
public static void main(String[] args){
Bird bird = new Bird();
bird.walk();
bird.fly();
}
}
The above code will print:
I am walking
I am flying
This means that a Bird object has all the properties that an Animal object has, as well as some additional unique properties.
The code above is provided for you in your editor. You must add a sing method to the Bird class, then modify the main method accordingly so that the code prints the following lines:
I am walking
I am flying
I am singing
ACME Green is a huge, strategic project across all the companies in the ACME Technologies group.
Tshepo knows that technology will not be the only aspect he will need to manage well for the
project to be successful – he also needs the right people.
List five types of users that would be using the operational carbon accounting database and
explain what the responsibility of each type of user will be in ACME Technologies.
create table guest (
guestfname varchar(50) not null,
guestlname varchar(50) not null,
guestphone number(10),
guestadd varchar,
guestID varchar(10) not null,
constraint pk_bill primary key (guestphone),
references room (guestID)
);
When I run it says missing left parenthesis Why??
Directions: Give an example on how to illustrate the use of the following SQL DDL Commands.
1. Create a database using the CREATE DATABASE command.
2. Create a database table using the CREATE command.
3. After a table in SQL using the ALTER command, and show how to add new column to the existing table.
4. List the content of a table using the SELECT columnist command.
5. How to update table rows using the UPDATE command.
6 Delete a database in SQL using the DROP DATABASE command.
7.Delete a table in a database.
Write PL/SQL block to create a trigger to update the records according to working days that is you can not update record in holidays