In: Computer Science
answer the following question for oracle developer:
1- ____ is the category of SQL commands to create, alter or drop SQL objects (create a table, drop a view)
2-____ handles access to objects. The DBA might grant select on Customers to Bob. This will allow user Bob to read the Customers table.
3- Run this query in SQL Developer:
Select sysdate
from dual
What is sysdate? What is dual?
4-What is a surrogate key? How are surrogate keys implemented in Oracle?
5-Which are DML commands?
6- Rules for a table: choose what is best
a- Name should not contain spaces
b- Name must start with an alpha character
c-Must be unique in the schema
d-Must contain a Primary Key
e-Must be unique in the database
f-Must contain at least one column
g-Primary Key must be first column in the database
7- What is First Normal Form (1NF)? What condition would violate 1NF?
8- ____ are SQL commands used to handle data in tables. Typical commands are Select, Update, Insert, Delete and Merge
9-Which are valid DDL commands?
10-A table has two (or more) columns that make up the Primary Key. This is called a(n) ____ key.
11-A column that's nchar(5) takes up ____ bytes of data.
12- Maximum number of columns for an Oracle table is ____ columns
13-Define: null. What is null? What does it mean? How are nulls treated?
14-
Run the following query in SQL Developer:
select to_char(sysdate + 2,'mm/dd hh24:mm')
from dual
What is returned?
Change the query to return the last day of the month (if sysdate is
2/14/2017, return 2/28/2017).
15- One-to-one relationships between two tables in a database are rare. Why? Give me a scenario where 1:1 relationship would be implemented?
Answer of the above questions are as follows -
Que 1) ____ is the category of SQL commands to create, alter or drop SQL objects (create a table, drop a view)
Answer : Data Definition Language (DDL)
Que 2) ____ handles access to objects. The DBA might grant select on Customers to Bob. This will allow user Bob to read the Customers table.
Answer : SQL GRANT
Que 3) Run this query in SQL
Developer:
Select sysdate
from dual
What is sysdate? What is dual?
Answer : sysdate returns the current date and time set for the operating system on which the database is present. and when you want to use a SQL function and you have no table, you have to use dual which is a special one-row and one-column named dummy table.
Que 4) What is a surrogate key? How are surrogate keys implemented in Oracle?
Answer : surrogate key is used to apply uniform rules to all records of table. This key is any column or set of columns that can be declared as the primary key . This key don't have business meaning, Surrogate keys can also include the current system date/time stamp, or a random alphanumeric string.
Que 5) Which are DML commands?
Answer : DML means Data Manipulation Language . DML is used to manipulate data itself. most common DML SQL statements such SELECT, INSERT, UPDATE, DELETE etc, and it is used to store, modify, retrieve, delete and update data in database.