Hello Freelancer, Get the POSTGRESQL TEST of Latest version 2018. We are ready here to provide your desire upwork test answer. We already tested all exam test information Available include on here. So Dear, Why Late? Read the below full exam test and get more information from our website.
1. Which of the following are supported by PostgreSQL?
Answers:
- Multi version concurrency control transactions
- Multi-user support
- Declarative SQL queries
- Query optimization
2. Point out the incorrect statement regarding group functions:
Answers:
- Group functions act on a group of rows
- Group functions return one result for all the rows operated upon
- Group functions ignore the null values
- Stddev and variance are examples of group functions
- One cannot combine group and single value functions in a query
- Sum is not a group function
3. Which of the following date function(s) are invalid?
Answers:
- NEXT_DAY
- NEXT_MONTH
- MONTHS_BETWEEN
- DAYS_BETWEEN
4. Which of the following functionalities is supported by the pg_ctl script?
Answers:
- status
- start
- stop
- restart
- invoke
- all of the above
5. In which of the following ways can a value in an array column be modified?
Answers:
- Element modification
- Columnar modification
- Slice modification
- Complete modification
6. Which of the following are valid in a declare block?
Answers:
- intCustomerId int4 := 67;
- intCustomerId int4 = 67;
- intCustomerId int4;
- intCustomerId int4; intCustomerId:= 67
7. For which of the following languages does PostgreSQL provide an API interface?
Answers:
- Python and Perl
- C/C++ and Java
- PHP and Ruby
- Small talk
8. Data validation can be implemented at the definition stage through:
Answers:
- Check constraints with specified values
- Referential constraints, by creating a foreign key for another table
- Default value of a column
- Null constraints
9. Which of the following statements is not correct about creating a new operator?
Answers:
- Name and functionname clause must be specified
- LEFTARG or RIGHTARG must be defined
- Overloading is not possible in operators
- COMMUTATOR attribute must be specified
10. Examine the following query:
Create table Person
(EmpNo Number(4) not null,
EName Char not null,
Join_dt Date not null,
Pay Number)
(EmpNo Number(4) not null,
EName Char not null,
Join_dt Date not null,
Pay Number)
Which of the following field(s) are created correctly?
Answers:
- EmpNo
- EName
- Join_dt
- Pay
11. How can data be accessed by users who do not have direct access to the tables?
Answers:
- By creating views
- By creating triggers
- By creating stored procedures
- None of the above
12. Which of the following statements are incorrect regarding referential integrity?
Answers:
- A foreign key can refer to a primary key
- A foreign key can refer to a unique key
- The on delete cascade clause will work only if there is a reference to a primary key
- The referred key can either be in the same table or in some other table
- A foreign key can be composite
- Referential integrity can only be applied while creating the table
13. Which of the following statements regarding views are incorrect?
Answers:
- A view is like a window through which data in tables can be viewed or changed
- A view is derived from another table
- A view cannot be derived from another view
- A view is stored as a select statement only
- A view has no data of its own
- A view is another name for a table
14. Which of the following statements is correct?
Answers:
- PostgreSQL is written in C
- PostgreSQL can dynamically load compiled code for C on the fly
- All the users are allowed to use CREATE FUNCTION to link to a C function
- All of the above
15. Which statements hold true for Partition Tables?
Answers:
- A table may be split into several independent pieces
- All pieces must have the same size
- A partition may be analyzed and exported
- A partition cannot be truncated
- When one partition goes offline, other partitions still remain available
16. Which of the following is correct regarding VACUUM?
Answers:
- It deletes the temporary data and recovers the disk space
- The table identifier must be provided
- A VACUUM statement will clean up each table in the presently connected database
- All of the above
17. Which of the following techniques can be used to obtain a result which is based on comparing one row of a table with another row of the same table?
Answers:
- Equi-join
- Inner Join
- Outer Join
- Self Join
- Correlated Subquery
18. Which method should be used to drop the master table if its primary key is being referenced by a foreign key in some other table?
Answers:
- Use cascade constraints clause with drop table
- Disable the foreign key of the detail table
- Drop the primary and foreign key constraints of both the tables
- None of the above
19. There is a column c1 in the table t to which a primary key pk is to be added. What will be the correct syntax?
Answers:
- Alter table t add primary key(c1);
- Alter table t add constraint pk primary key(c1);
- Alter table t add (constraint pk primary key(c1));
- Alter table t add pk constraint primary key(c1);
20. Which of the following are not DCL operations?
Answers:
- Insert
- Grant
- Delete
- Update
- Revoke
- Commit
- Rollback
21. Which of the following holds true for functions in PostgreSQL?
Answers:
- The parameters are positional
- Functions may be overloaded
- A variation of the SQL99 CREATE FUNCTION command is supported
- All of the above
22. Choose the correct statements for a trigger function:
Answers:
- It is created using the CREATE FUNCTION command
- It should be defined as accepting single arguments
- It returns a value of integer datatype
- It returns a value of integer or opaque datatype
23. Perfect Services provides financial services. You need to display data from the pers table for joining_date from #1/1/2005# to #31/12/2005# and the job should be for Analyst or Clerk or Salesman. Which select statement will you use?
Answers:
- select * from Pers where joining_date from #1/1/2005# to #31/12/2005#, job=Analyst or clerk or salesman
- select * from Pers where joining_date between #1/1/2005# to #31/12/2005#, job=Analyst or job=clerk or job=salesman
- select * from Pers where joining_date between #1/1/2005# and #31/12/2005# and (job=Analyst or clerk or salesman)
- None of the above
24. Which of the following is correct for the postmaster -n debugging option?
Answers:
- It stops the postmaster from re-initializing shared data structures
- It allows a developer to collect a core dump from each backend process manually
- It causes the postmaster to use the SIGSTOP signal to stop backend processes
- None of the above
25. There is a table t upon which a primary key constraint by the name pk is applied. What will be the correct syntax to drop the constraint?
Answers:
- Alter table t drop primary key
- Alter table t drop constraint pk
- Drop primary key constraint on table t
- Alter table t delete primary key
26. Which of the following variable declarations is not correct?
Answers:
- cust_id INTEGER;
- meter_name VARCHAR(30);
- net_amt FLOAT(2);
- update_time timestamp;
27. What do you understand by the following PL/pgSQL declaration?
c_phone customer.contact_no%TYPE;
Answers:
- This is declaring a new variable c_phone with undefined type
- This is declaring a new variable c_phone with same type as contact_no column
- This is declaring a new variable c_phone with variable data type
- None of the above is correct
28. Which of the following date and time constants are not defined in PostgreSQL?
Answers:
- today
- current
- epoch
- current_day
- yesterday
29. Select the appropriate query for the Products table when data should be primarily ordered by ProductGroup. ProductGroup should be displayed in ascending order and CurrentStock should be in descending order:
Answers:
- Select * from Products order by CurrentStock,ProductGroup
- Select * from Products order by CurrentStock DESC,ProductGroup
- Select * from Products order by ProductGroup,CurrentStock
- Select * from Products order by ProductGroup,CurrentStock DESC
- None of the above
30. Which of the following can be used to uniquely identify a row?
Answers:
- Primary Key
- Unique Key
- Foreign Key
- All of the above
31. Which clause should be used to display the rows of a table in ascending order of a particular column?
Answers:
- Where
- Order By
- Group By
- Having
- First Group By and then Having
- Like
- Between
32. Which of the following holds true if you have installed PL/pgSQL in the PgDatabase?
Answers:
- For all the subsequent databases that are created with PgDatabase as their template, the user must install PL/pgSQL
- All the subsequent databases that are created with PgDatabase as their template, will have PL/pgSQL installed
- For all the subsequent databases that are created with PgDatabase as their template, the user may or may not install PL/pgSQL
- None of the above are correct
33. Which of the following is not defined in the PL/pgSQL?
Answers:
- %Type
- %Coltype
- %Rowtype
- ALIAS
34. A handler named ‘plpgsqlHandle()’ is created for installing PL/pgSQL. For creating the handler on ‘SwineDB’ database you would issue a command:
Answers:
- SwineDB=# CREATE LANGUAGE ‘pl/pgsql’ HANDLER plpgsqlHandle SwineDB-# LANCOMPILER ‘Install PL/pgSQL’; CREATE
- SwineDB=# CREATE LANGUAGE ‘pl/pgsql’ EXECUTE plpgsqlHandle SwineDB-# LANCOMPILER ‘Install PL/pgSQL’; CREATE
- SwineDB=# CREATE LANGUAGE ‘plpgsql’ HANDLER plpgsqlHandle SwineDB-# LANCOMPILER ‘Install PL/pgSQL’; CREATE
- SwineDB=# CREATE LANGUAGE ‘plpgsql’ EXECUTE plpgsqlHandle SwineDB-# LANCOMPILER ‘Install PL/pgSQL’; CREATE
35. Normalization divides tables in a more useful and meaningful manner. Which statement is correct for the FIRST NORMAL FORM?
Answers:
- It includes only tables that do not have composite primary keys
- It must have data stored in a two-dimensional table with no repeating groups
- Every non-key column is non transitively dependent upon its primary key
- None of the above
36. What is the default location of the standard elog?
Answers:
- /var/log/messages
- $PGDATA/serverlog
- Any of the above
- None of the above
37. What does the pg_dump command do?
pg_dump CustomerDatabase
Answers:
- It copies the database to specified location
- It creates a list of SQL commands used to create db from scratch
- None of the above
38. What does the RAISE statement do in PL/pgSQL?
Answers:
- It logs the error to the logging utility
- It displays the error to stderr
- Both of the above
- None of the above
39. There are two tables A and B. You are retrieving data from both tables where all rows from table B and only matching rows from table A should be displayed. Which type of join will you apply between tables A and B?
Answers:
- Inner join
- Left outer join
- Right outer join
- Self join
40. Food Cart Accounting System (FOCAS) is maintaining products in the products table, and wants to see the products which are 50 or more numbers far from the minimum stock limit. The structure of the Products table is:
ProductID
ProductName
CurrentStock
MinimumStock
ProductID
ProductName
CurrentStock
MinimumStock
Two possible queries are:
Statement 1: select * from products where currentStock>MinimumStock+50
Statement 2: select * from products where currentStock-50>MinimumStock
Statement 2: select * from products where currentStock-50>MinimumStock
Select an option which is more suitable for these queries:
Answers:
- Only statement 1 is correct
- Only statement 2 is correct
- Both statements 1 and 2 are correct
- Both statements 1 and 2 are incorrect
41. Which of the following holds true when you have defined a function with “isstrict” attribute?
Answers:
- This will allow you to pre-evaluate a call to a function
- This will not allow you to pre-evaluate a call to a function if one of its arguments is NULL
- The function will always return a NULL value if more than one of its arguments is NULL
- The function will always return a NULL value whenever any of its arguments is NULL
42. Which of the following is true about PostgreSQL clients?
Answers:
- The graphical client application is psql
- The command line driven client is PgAccess
- psql client is installed by default
- PgAccess installation requires specification of the with-pgtcl option
43. Will the following function compile and execute?
DECLARE
intValue int4;
BEGIN
intValue := 20 * 20;
return intValue;
END;
intValue int4;
BEGIN
intValue := 20 * 20;
return intValue;
END;
Answers:
- It will not compile
- It will compile but will give a runtime error
- It will compile but will not produce any output
- It will compile and will produce 400 as output
44. In which order are primary queries and their sub-queries interpreted:
Answers:
- prime query followed by sub query followed by sub sub query and so on
- lowest sub query followed by sub query followed by prime query
- The whole query is interpreted at one time
- There is no fixed sequence of interpretation of a query
45. Which of the following copy commands will work in PostgreSQL?
Answers:
- COPY
- copy
- COPY .. TO
- All of the above
46. A wholesale merchant shop needs a report about the sale where total sale of the day is more than $50,000. Which of the following will fulfill this requirement?
Answers:
- select * from orders where sum(amount) > 50000
- select * from orders where sum(amount) > 50000 order by OrderDate
- select * from orders group by OrderDate where sum(amount) > 50000
- select * from orders group by OrderDate having sum(amount)>50000
47. Which of the following trigger function variables is not defined?
Answers:
- TG_NARGS
- NEW
- TG_NAME
- TG_WHERE
- OLD
- None of the above
48. Is function overloading available in PL/pgSQL?
Answers:
- True
- False
49. Can you define variables in PostgreSQL pl/pgSQL whose value cannot be null?
Answers:
- No, you cannot
- Yes, you can use ‘NOT NULL’ after datatype
- Yes, you can use ‘NON NULLABLE’ after datatype
- Yes, that is the default case, for setting it to hold null values ‘NULLABLE’ is used after datatype
50. What is the error in the following query if the students table contains several records?
select name from students where name =
(select name from students order by name);
select name from students where name =
(select name from students order by name);
Answers:
- = should be replaced by in operator
- Order by clause in the subquery should be preceded with a group by clause
- Order by clause in the subquery can be used only if the where and group by clauses have been applied
- Group by clause should be applied to the outer query
- An order by clause is not allowed in a subquery
- There is no error
51. Consider the following structure of the students table:
rollno number(4)
name varchar(20)
course varchar(20)
name varchar(20)
course varchar(20)
What will be the query to display the courses in which the number of students enrolled is more than 5?
Answers:
- Select course from students where count(course) > 5;
- Select course from students where count(*) > 5 group by course;
- Select course from student’s group by course;
- Select course from student’s group by course having count(*) > 5;
52. Choose the correct statement regarding WAL in PostgreSQL:
Answers:
- It increases the reliability of the database
- It logs the entries to the database automatically
- It is detrimental for database performance
- There is no such term defined in PostgreSQL
53. Which of the following functions is not available in PostgreSQL?
Answers:
- intfrombit
- bittoint4
- to_number
- to_timestamp
54. What is the first step in installing PL/pgSQL in PostgreSQL?
Answers:
- Use ‘CREATE FUNCTION’ to create the procedural call handler
- Use ‘CREATE LANGUAGE’ SQL command
- Either one of the above can be used
55. Which of the following is correct with regard to Password Authentication?
Answers:
- pg_shadow table stores the password as plain text
- pg_user table stores the password as encrypted text
- Only superusers have access to the system password storing table
- All of the above
56. A steel production company has two sales outlets. Both outlets are maintaining their data separately in servers SVA and SVD. Both outlets use the same structure for the Sales table. Which method will you use to create a combined sales report for both the outlets?
Answers:
- Select * from SVA.Sales join SVD.Sales
- Select * from SVA.Sales union all SVD.Sales
- select * from SVA.Sales,SVD.Sales
- None of the above
57. Which of the following help PostgreSQL avoid unnecessary locking of records?
Answers:
- Multi Lock
- MCVR
- MVCC
- MVSQL
58. Which of the following programming structures is not available in PL/pgSQL?
Answers:
- IF THEN ELSE
- LOOP
- WHILE
- DO WHILE
- FOR
59. When should sub queries be used?
Answers:
- To define the set of rows to be inserted in a table
- To define the set of rows to be included in a view
- To define one or more values to be assigned to existing rows
- To provide values for conditions in the Where clause
- All of the above are correct
60. What is the default variable for the PROMPT3?
Answers:
- ‘>>> ‘
- ‘>> ‘
- ‘%/%R%# ‘
- ‘%/%R%# ‘
61. What does the following update statement do?
Update OrderTable set OrderDiscount=OrderDiscount*1.10
Answers:
- It increases OrderDiscount of the first row by 10%
- It increases OrderDiscount of all rows by 10%
- It does nothing without the where clause
- It generates an error due to the lack of a where clause
62. Which of the following files controls the host based authentication in PostgreSQL?
Answers:
- pg_host_auth.conf
- pghba.conf
- pg_hba.conf
- pghostauth.conf
63. A PL/pgSQL code block is defined with DECLARE, BEGIN and END. How many such sub blocks can be nested within a block?
Answers:
- None
- 2
- 8
- Unlimited
64. What is a cluster?
Answers:
- A group of users
- A group of indexes
- A method of storing tables that are intimately related and often stored together into the same area of the disk
- A compressed datafile
- A segment of a partitioned table
- A group of constraints
- A group of databases
- A group of roles
65. Which of the following security features is inbuilt in PostgreSQL?
Answers:
- Stunnel
- SSL on compiling with -with-ssl
- SSH/OpenSSH
- None of the above
66. Choose the correct statement:
Answers:
- All PL/pgSQL expressions in a function, except dynamic queries, are only prepared once during the lifetime of the PostgreSQL backend process
- All PL/pgSQL expressions in a function are only prepared once during the lifetime of the PostgreSQL backend process
- All PL/pgSQL expressions in a function are prepared for each execution time during the lifetime of the PostgreSQL backend process
- None of the above is correct
67. If entity x is existence-dependent on entity y, then what is x called?
Answers:
- Dominant entity
- Subordinate entity
- Primary entity
- Secondary entity
68. What do you infer from the following two lines?
1. host all 192.168.1.10 255.255.255.255 reject
2. host all 127.0.0.1 255.255.255.255 trust
2. host all 127.0.0.1 255.255.255.255 trust
Answers:
- Line 1 is a valid host based client config entry
- Line 2 is a valid host based client config entry
- Line 1 and Line 2 both are valid host based client config entries
- Both Line 1 and Line 2 are invalid host based client config entries
69. Which of the following statements are true for views?
Answers:
- A view is stored in the data dictionary
- Views provide a more secure way of data retrieval
- Views are actual tables and store data at another location
- All of the above are true
70. What is wrong in this query:
Select * from Orders where OrderID=(select OrderID from OrderItems where ItemQty>50)
Answers:
- In a sub query, * should be used instead of OrderID
- The sub query can return more than one row, so, = should be replaced with in
- The sub query should be used first
- None of the above
71. Which of the following is not an SQL operator?
Answers:
- Between .. and ..
- Like
- In
- Is null
- Having
- Not in
72. Which of the following clauses are not allowed in a single row sub-query?
Answers:
- From
- Where
- Group by
- Having
- Order by
73. The names of those departments where there are more than 100 employees have to be displayed. Given two relations, employees and departments, which query should be used?
Employee
——–
Empno
Employeename
Salary
Deptno
Employee
——–
Empno
Employeename
Salary
Deptno
Department
———
Deptno
Departname
———
Deptno
Departname
Answers:
- Select departname from department where deptno in (select deptno from employee group by deptno having count(*) > 100);
- Select departname from department where deptno in (select count(*) from employee group by deptno where count(*) > 100);
- Select departname from department where count(deptno) > 100;
- Select departname from department where deptno in (select count(*) from employee where count(*) > 100);
74. The primary key indexing technique does not allow:
Answers:
- Duplicate data in a field
- Multiple attributes
- Sets of relations
- Many to Many relation
75. You want to manipulate some value in the database upon updation in a trigger function. Which line of the code would be appropriate?
Answers:
- IF TG_RELID = ”UPDATE” THEN –Modify the database value END IF;
- IF TG_NAME = ”UPDATE” THEN –Modify the database value END IF;
- IF TG_OP = ”UPDATE” THEN –Modify the database value END IF;
- IF TG_ARGV = ”UPDATE” THEN –Modify the database value END IF;
76. Which of the following statements is correct with regard to PostgreSQL?
Answers:
- It is an Object Oriented Database Management System
- It is an Object Relational Database Management System
- It is a Relational Database Management System
- It is an Object Based Database Management System
77. Which of the following geometric types is not defined in PostgreSQL?
Answers:
- path
- box
- hexagon
- polygon
78. You want to update the last modified timestamp in the orders table. The correct way to do this in a PL/pgSQL function, when the parameter integer order_id is passed, would be:
Answers:
- DECLARE order_id ALIAS FOR $1; mytimestamp timestamp; BEGIN mytimestamp := ”now”; UPDATE orders SET orderid=order_id, lastmodified = mytimestamp; RETURN mytimestamp; END; ‘ LANGUAGE ‘plpgsql’;
- DECLARE order_id ALIAS FOR $1; mytimestamp timestamp; BEGIN mytimestamp := ‘now’; UPDATE orders SET orderid=order_id, lastmodified = mytimestamp; RETURN mytimestamp; END; ‘ LANGUAGE ‘plpgsql’;
- DECLARE order_id ALIAS FOR $1; BEGIN mytimestamp := ”now”; UPDATE orders SET orderid=order_id, lastmodified = ”now”; RETURN mytimestamp; END; ‘ LANGUAGE ‘plpgsql’;
- DECLARE order_id ALIAS FOR $1; BEGIN mytimestamp := ”now”; UPDATE orders SET orderid=order_id, lastmodified = ‘now’; RETURN mytimestamp; END; ‘ LANGUAGE ‘plpgsql’;
79. You have defined a function “Calculate()” in the template1 database. What will happen when you create a new database “ManagementDB” there?
Answers:
- The function will be moved to the new database
- The function will be cloned to the new database
- The function will remain with the template database only
- Any of the above can happen
80. Which of the following is not a single value function?
Answers:
- Round
- Floor
- Avg
- Sqrt
- Tan
81. Which component of a DBMS verifies the syntax of the users query?
Answers:
- Parser
- The database manager
- Query optimization
- Database administrator
82. Every Boyce-Codd Normal Form(BCNF) is in:
Answers:
- First Normal Form
- Second Normal Form
- Third Normal Form
- None of the above
83. Which of the following values is not defined to indicate the level of the raise event?
Answers:
- DEBUG
- ERROR
- NOTICE
- EXCEPTION
84. Which character function should be used to return a specified portion of a character string?
Answers:
- CONCAT
- LENGTH
- SUBSTR
- INITCAP
Finally no more words require about the POSTGRESQL TEST information in this session of this content. If you are require knowing more, Please ask to us via our contact us form or comment box. Please make sure that, you don’t send Personal information via the Comment box. Thanks for Being with us.
No comments:
Post a Comment