Skip to main content

Posts

Showing posts from November, 2018

About Application

The product is supposed to be an open source application, developed under the PRSC(Punjab Remote Sensing Centre)organization, for the usage of PUDA(Punjab Urban Planning and Development Authority ). It is An android based system implementing client-server model. The Po portal System provides simple mechanism for the Planning officer to share  truly verified report. The following are the main features that are included in the application are: Common platform support: Offers operating support for most of the known and commercial operating systems i.e. android operating system. Number of users being supported by the system: Though the number is precisely not mentioned but the system is able to support a large number of online users at a time. Search: search for the pending list of the cases assigned is generally by logging in to the application. Id system: provides each officer with a unique Id which is sent at the time of report submission. Verification  section: Verif...

SQL SERVER - TABLES (CONT.)

Description The SQL Server (Transact-SQL) ALTER TABLE statement is used to add, modify, or drop columns in a table. Add column in table You can use the ALTER TABLE statement in SQL Server to add a column to a table. Syntax The syntax to add a column in a table in SQL Server (Transact-SQL) is: ALTER TABLE table_name ADD column_name column_definition; Example Let's look at an example that shows how to add a column in an SQL Server table using the ALTER TABLE statement. For example: ALTER TABLE employees ADD last_name VARCHAR(50); This SQL Server ALTER TABLE example will add a column to the  employees  table called  last_name . Add multiple columns in table You can use the ALTER TABLE statement in SQL Server to add multiple columns to a table. Syntax The syntax to add multiple columns to an existing table in SQL Server (Transact-SQL) is: ALTER TABLE table_name ADD column_1 column_definition, column_2 column_definition, ...

SQL Server- Tables

CREATE TABLE Description The SQL Server (Transact-SQL) CREATE TABLE statement allows you to create and define a table. Syntax The syntax for the CREATE TABLE statement in SQL Server (Transact-SQL) is: CREATE TABLE table_name ( column1 datatype [ NULL | NOT NULL ], column2 datatype [ NULL | NOT NULL ], ... ); Parameters or Arguments table_name The name of the table that you wish to create. column1, column2 The columns that you wish to create in the table. Each column must have a datatype. The column should either be defined as NULL or NOT NULL and if this value is left blank, the database assumes NULL as the default. Example Let's look at an example of how to use the CREATE TABLE statement in SQL Server (Transact-SQL). For example: CREATE TABLE employees ( employee_id INT NOT NULL, last_name VARCHAR(50) NOT NULL, first_name VARCHAR(50), salary MONEY ); This SQL Server CREATE TABLE example creates a table called  employees  which h...

SQL Functions

Count function Description In SQL Server (Transact-SQL), the COUNT function returns the count of an expression. Syntax The syntax for the COUNT function in SQL Server (Transact-SQL) is: SELECT COUNT(aggregate_expression) FROM tables [WHERE conditions]; OR the syntax for the COUNT function when grouping the results by one or more columns is: SELECT expression1, expression2, ... expression_n, COUNT(aggregate_expression) FROM tables [WHERE conditions] GROUP BY expression1, expression2, ... expression_n; Parameters or Arguments expression1, expression2, ... expression_n Expressions that are not encapsulated within the COUNT function and must be included in the GROUP BY clause at the end of the SQL statement. aggregate_expression This is the column or expression whose non-null values will be counted. tables The tables that you wish to retrieve records from. There must be at least one table listed in the FROM clause. WHERE conditions Optional. These are ...

SQL Server - INTERSECT Operator

Description The SQL Server (Transact-SQL) INTERSECT operator is used to return the records that are in common between two SELECT statements or data sets. If a record exists in one query and not in the other, it will be omitted from the INTERSECT results. It is the intersection of the two SELECT statements. Intersect Query Explanation:  The INTERSECT query will return the records in the blue shaded area. These are the records that exist in both Dataset1 and Dataset2. Each SELECT statement within the SQL Server INTERSECT must have the same number of columns in the result sets with similar data types. Syntax The syntax for the NTERSECT operator in SQL Server (Transact-SQL) is: SELECT expression1, expression2, ... expression_n FROM tables [WHERE conditions] INTERSECT SELECT expression1, expression2, ... expression_n FROM tables [WHERE conditions]; Parameters or Arguments expressions The columns or calculations that you wish to compare between the two SELECT ...

SQL Server - UNION ALL Operator

Description The SQL Server UNION ALL operator is used to combine the result sets of 2 or more SELECT statements. It returns all rows from the query and it does not remove duplicate rows between the various SELECT statements. Each SELECT statement within the SQL Server UNION ALL operator must have the same number of fields in the result sets with similar data types. Syntax The syntax for the UNION ALL operator in SQL Server (Transact-SQL) is: SELECT expression1, expression2, ... expression_n FROM tables [WHERE conditions] UNION ALL SELECT expression1, expression2, ... expression_n FROM tables [WHERE conditions]; Parameters or Arguments expression1, expression2, ... expression_n The columns or calculations that you wish to retrieve. tables The tables that you wish to retrieve records from. There must be at least one table listed in the FROM clause. WHERE conditions Optional. The conditions that must be met for the records to be selected. Note There must be...

SQL Sever- UNION Operator

Description The SQL Server UNION operator is used to combine the result sets of 2 or more SELECT statements. It removes duplicate rows between the various SELECT statements. Each SELECT statement within the UNION operator must have the same number of columns in the result sets with similar data types. Syntax The syntax for the UNION operator in SQL Server (Transact-SQL) is: SELECT expression1, expression2, ... expression_n FROM tables [WHERE conditions] UNION SELECT expression1, expression2, ... expression_n FROM tables [WHERE conditions]; Parameters or Arguments expression1, expression2, ... expression_n The columns or calculations that you wish to retrieve. tables The tables that you wish to retrieve records from. There must be at least one table listed in the FROM clause. WHERE conditions Optional. The conditions that must be met for the records to be selected. Note There must be same number of expressions in both SELECT statements. The corresponding...

SQL SERVER- Truncate Table Statement

Description The TRUNCATE TABLE statement is used to remove all records from a table in SQL Server. It performs the same function as a DELETE statement without a WHERE clause. Syntax The syntax for the TRUNCATE TABLE statement in SQL Server (Transact-SQL) is: TRUNCATE TABLE [database_name.] [schema_name.] table_name [ WITH ( PARTITIONS ( partition_number | partition_number TO partition_number ) ] ; Parameters or Arguments database_name Optional. If specified, it is the name of the database. schema_name Optional. If specified, it is the name of the schema that the table belongs to. table_name The table that you wish to truncate. WITH ( PARTITIONS ( partition_number | partition_number TO partition_number ) Optional and can only be used with partitioned tables. If specified,  partition_number  is the number of the partition that you wish to truncate in the partitioned table. To list multiple partitions, comma separate the partition num...

SQL Server - Delete Statement

Description The SQL Server (Transact-SQL) DELETE statement is used to delete a single record or multiple records from a table in SQL Server. Syntax In the simplest form, the syntax for the DELETE statement in SQL Server (Transact-SQL) is: DELETE FROM table [WHERE conditions]; However, the full syntax for the DELETE statement in SQL Server (Transact-SQL) is: DELETE [ TOP (top_value) [ PERCENT ] ] FROM table [WHERE conditions]; Parameters or Arguments table The table that you wish to delete records from. WHERE conditions Optional. The conditions that must be met for the records to be deleted. TOP (top_value) Optional. If specified, it will delete the top number of rows in the result set based on  top_value . For example, TOP(10) would delete the top 10 rows matching the delete criteria. PERCENT Optional. If PERCENT is specified, then the top rows are based on a  top_value  percentage of the total result set (as specfied by the  PERCENT ...

SQL Server - Update Statement

Description The SQL Server (Transact-SQL) UPDATE statement is used to update existing records in a table in a SQL Server database. There are 3 syntaxes for the UPDATE statement depending on whether you are performing a traditional update or updating one table with data from another table. Syntax The syntax for the UPDATE statement when updating one table in SQL Server (Transact-SQL) is: UPDATE table SET column1 = expression1, column2 = expression2, ... [WHERE conditions]; OR The syntax for the UPDATE statement when updating one table with data from another table in SQL Server (Transact-SQL) is: UPDATE table1 SET column1 = (SELECT expression1 FROM table2 WHERE conditions) [WHERE conditions]; OR The syntax for the SQL Server UPDATE statement when updating one table with data from another table is: UPDATE table1 SET table1.column = table2.expression1 FROM table1 INNER JOIN table2 ON (table1.column1 = table2.column1) [WHERE con...

SQL Server - INSERT Statement

Description The SQL Server (Transact-SQL) INSERT statement is used to insert a single record or multiple records into a table in SQL Server. Syntax In its simplest form, the syntax for the INSERT statement when inserting a single record using the VALUES keyword in SQL Server (Transact-SQL) is: INSERT INTO table (column1, column2, ... ) VALUES (expression1, expression2, ... ), (expression1, expression2, ... ), ...; However, the full syntax for the INSERT statement when inserting a single record using the VALUES keyword in SQL Server (Transact-SQL) is: INSERT INTO table (column1, column2, ... ) VALUES ( DEFAULT | NULL | expression1, DEFAULT | NULL | expression2, ... ); Or... The syntax for the SQL Server INSERT statement when inserting a single record using the DEFAULT VALUES keyword is: INSERT INTO table (column1, column2, ... ) DEFAULT VALUES; Or... In its simplest form, the syntax for the SQL Server INSERT statement when inserting multiple records usin...

SQL Server - Select INTO Statement

Description The SQL Server (Transact-SQL) SELECT INTO statement is used to create a table from an existing table by copying the existing table's columns. It is important to note that when creating a table in this way, the new table will be populated with the records from the existing table (based on the  SELECT Statement ). Syntax The syntax for the SELECT INTO statement in SQL Server (Transact-SQL) is: SELECT expressions INTO new_table FROM tables [WHERE conditions]; Parameters or Arguments expressions The columns or calculations that you wish to retrieve. new_table The new table to create with the selected  expressions  and their associated definitions ( new_table  must not exist). tables The tables that you wish to retrieve records from. There must be at least one table listed in the FROM clause. WHERE conditions Optional. The conditions that must be met for the records to be selected. Note When using the SELECT INTO statement in ...