FMA Function in C++

Sunidhi Bansal
Updated on 28-Feb-2020 05:42:33

63 Views

Given the task is to show the working of fma() function in C++. In this article we will look into what parameters this function need and what results it will be returning.fma() is an inbuilt function of cmath header file, which accepts three parameters x, y and z and return the result x*y+z without losing the precision in any intermediate result.Syntaxfloat fma(float x, float y, float z);Ordouble fma(double x, double y, double z); Orlong double fma(long double x, long double y, long double z);Parametersx − The first element to be multiplied.y − The second element with which x is to ... Read More

fread Function in C++ Program

Sunidhi Bansal
Updated on 28-Feb-2020 05:37:05

922 Views

Given the task is to show the working of fread() in C++. In this article we will also look into the different parameters which are passed to fread() and what this function returns.fread() is an inbuilt function of C++ which reads a block of data from the stream. This function counts the number of objects each with the size of “size” bytes from the stream and stores them in buffer memory, then position pointer advanced by the total amount of bytes read. The amount of bytes read if successful will be size *count.Syntaxfread(void *buffer, size_t size, size_t count, FILE *file_stream);ParametersThis ... Read More

Update with Logical AND Operator in MySQL

AmitDiwan
Updated on 28-Feb-2020 05:34:58

426 Views

For this, you can use AND operator with WHERE clause. Let us first create a table −mysql> create table DemoTable1616     -> (     -> StudentId int,     -> StudentName varchar(20),     -> StudentMarks int     -> ); Query OK, 0 rows affected (0.44 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1616 values(101, 'Chris', 56); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable1616 values(102, 'Bob', 87); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable1616 values(103, 'David', 56); Query OK, 1 row affected (0.20 sec) ... Read More

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

144 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

256 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

184 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

178 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

697 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

334 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.

Advertisements