Count Present and Absent Students for a Year in MySQL

AmitDiwan
Updated on 28-Feb-2020 05:31:07

1K+ Views

For this, you can use IF() along with aggregate function SUM(). Let us first create a table −mysql> create table DemoTable1617     -> (     -> Attendance varchar(20),     -> CurrentYear int     -> ); Query OK, 0 rows affected (0.48 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1617 values('Present', 2019); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable1617 values('Absent', 2019); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable1617 values('Absent', 2017); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable1617 values('Present', 2019); Query ... Read More

Deque CRend in C++ STL

Sunidhi Bansal
Updated on 28-Feb-2020 05:29:25

170 Views

Given is the task to show the functionality of Deque crend( ) function in C++ STLWhat is Deque?Deque is the Double Ended Queues that are the sequence containers which provides the functionality of expansion and contraction on both the ends. A queue data structure allow user to insert data only at the END and delete data from the FRONT. Let’s take the analogy of queues at bus stops where the person can be inserted to a queue from the END only and the person standing in the FRONT is the first to be removed whereas in Double ended queue the ... Read More

Select Total from a MySQL Table Based on Month

AmitDiwan
Updated on 28-Feb-2020 05:26:08

289 Views

For this, you can use GROUP BY MONTH(). Let us first create a table −mysql> create table DemoTable1628     -> (     -> PurchaseDate date,     -> Amount int     -> ); Query OK, 0 rows affected (1.55 sec)Insert some records in the table using insert command.mysql> insert into DemoTable1628 values('2019-01-10', 1500); Query OK, 1 row affected (0.68 sec) mysql> insert into DemoTable1628 values('2019-10-10', 2000); Query OK, 1 row affected (0.61 sec) mysql> insert into DemoTable1628 values('2019-10-24', 100); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable1628 values('2019-11-10', 500); Query OK, 1 row affected ... Read More

Deque Emplace in C++ STL

Sunidhi Bansal
Updated on 28-Feb-2020 05:23:51

209 Views

Given is the task to show the functionality of Deque emplace( ) function in C++ STLWhat is Deque?Deque is the Double Ended Queues that are the sequence containers which provides the functionality of expansion and contraction on both the ends. A queue data structure allow user to insert data only at the END and delete data from the FRONT. Let’s take the analogy of queues at bus stops where the person can be inserted to a queue from the END only and the person standing in the FRONT is the first to be removed whereas in Double ended queue the ... Read More

MySQL Stored Generated Columns with Built-in Functions

Chandu yadav
Updated on 27-Feb-2020 12:30:33

201 Views

It can be illustrated with the help of an example in which we are creating a stored generated column in the table named ‘employee_data_stored’. As we know that stored generated column can be generated by using the keyword ‘stored’.Examplemysql> Create table employee_data_stored(ID INT AUTO_INCREMENT PRIMARY KEY, First_name VARCHAR(50) NOT NULL, Last_name VARCHAR(50) NOT NULL, FULL_NAME VARCHAR(90) GENERATED ALWAYS AS(CONCAT(First_name, ' ', Last_name)) STORED); Query OK, 0 rows affected (0.52 sec) mysql> DESCRIBE employee_data_stored; +------------+-------------+------+-----+---------+------------------+ | Field      | Type        | Null | Key | Default | Extra            | +------------+-------------+------+-----+---------+------------------+ | ... Read More

What Happens to MySQL Transaction if Session is Killed by DBA

Swarali Sree
Updated on 27-Feb-2020 11:09:23

737 Views

Suppose if a session is killed in the middle of a transaction then that current MySQL transaction will be rolled back by MySQL and ended. It means that all the database changes made in the current transaction will be removed. It is called n implicit rollback when the session is killed.ExampleSuppose we have the following values in the table ‘marks’mysql> Select * from marks; +------+---------+-----------+-------+ | Id   | Name    | Subject   | Marks | +------+---------+-----------+-------+ |    1 | Aarav   | Maths     |    50 | |    1 | Harshit | Maths   ... Read More

Managing Cross-Database Container Access in SAP HANA

John SAP
Updated on 27-Feb-2020 10:58:15

357 Views

The cross database container access is managed in Global.ini file in Configuration under System Administration.To access global.ini file you need to navigate to Administration tab in HANA Studio → Configuration and there you can find Global.ini file.

Check a Table Inside a Schema in SAP HANA Database

John SAP
Updated on 27-Feb-2020 10:55:51

3K+ Views

Note that you need to check table under schema name under which it is created. You can confirm schema name on top of SQL editor.In below snapshot, you can Current Schema: AA_HANA11.To check if table is created, go to schema name under Catalog folder → Tables and search for the table name used in SQL query.

Viewing Table Definition in SAP HANA

John SAP
Updated on 27-Feb-2020 10:53:53

3K+ Views

To check table definition, you need to right click on table name → Open Definition and this will open table structure under HANA database.

Use of SQL MDX Processor in SAP HANA Index Server

Anil SAP Gupta
Updated on 27-Feb-2020 10:45:44

571 Views

SQL/MDX processor in HANA system processes all SQL and MDX statements executed in HANA system. SQL statements are generated for all the tables, schemas and MDX statements are raised for OLAP data processing. SQL stands for Structured Query Language and is Relational database language to manage two dimensional objects in HANA db.MDX stands for Multi Dimension Expression and is an OLAP language for processing MDX statements for multidimensional models.SQL/MDX Processor directs all the statement to relevant engines for processing and Engine optimization. It is used for authorization management in executing queries and Error handling while processing SQL/MDX statements.Following functions are ... Read More

Advertisements