Both count(*) and count(x) return the number of rows in the sample_table.
Choose an appropriate explanation for this.
The create function fails because a semicolon is required after declare on the second line.
PL/pgSQL is used to define a function.
Create a partitioned table using the CREATE PARTITIONED TABLE command.
A directory to be used as a tablespace is specified in the CREATE TABLESPACE command, but the directory must already exist and be empty.
SELECT * FROM bar; will result in an error as it fails to find the table foo.bar.
BEFORE statement -> BEFORE row -> AFTER statement -> AFTER row
Add a column to a view.
When a table has a FOREIGN KEY constraint
Name of the table
integer is a 4-byte integer that can safely contain up to 10 digits.
real and double precision are floating point real numbers, and double precision can perform more accurate operations.
In either method, the parent table is created using the usual CREATE TABLE parent... and no special options are needed to use partitions.
When creating a partition, the command is
CREATE TABLE partition1 PARTITION OF parent...
for declarative partitioning, and
CREATE TABLE partition1 () INHERITS (parent)
for inheritance, both using CREATE TABLE.
The command used to create it is in the format of
CREATE MATERIALIZED VIEW mview AS SELECT ... FROM table1, table2...
Rather than executing the SELECT statement used in the AS clause during creation,
SELECT * FROM mview
is usually faster.
A PROCEDURE is created with the CREATE PROCEDURE command, and a FUNCTION is created with the CREATE FUNCTION command.
While PROCEDURE is defined in the SQL standard, FUNCTION is a PostgreSQL-specific extension.
The server machine's hardware clock is faulty.
The timed command is not executed on the server machine, so the time is not accurately maintained.
Reduce the disk space occupied by data.
Significantly improve the performance of queries.
Place the new database created by CREATE DATABASE in a tablespace different from the default one.
Both are created with the CREATE VIEW command.
If the view definitions are the same, a SELECT from either will always return the same result.
Materialized views require disk space according to the amount of data they contain, while regular views do not require disk space.
To modify a query that defines a view, the CREATE OR REPLACE VIEW command is used for a regular view, whereas a special command called REFRESH MATERIALIZED VIEW is used for a materialized view.
DELETE FROM xxx, yyy WHERE xxx.id = yyy.id;
DELETE FROM xxx JOIN yyy USING xxx.id = yyy.id;
DELETE FROM xxx WHERE id IN (SELECT id FROM yyy);
DELETE FROM xxx WHERE EXISTS (SELECT id FROM yyy);
© EDUCO (General Incorporated Association Educo) all rights reserved.